package com.jiao.testdemo.pattern.visitor;

import java.util.ArrayList;
import java.util.List;

/**
 * TODO(文件概要)
 *
 * <p> TODO(具体描述信息,可以不填)
 *
 * @author meetsocial
 * @version V1.0
 * @className: ObjectStructure
 * @date 2024/11/15 11:34
 */
public class ObjectStructure {

    private List<Element> elements = new ArrayList<>();

    public void addElement(Element element) {
        elements.add(element);
    }

    public void accept(Visitor visitor) {
        for (Element element : elements) {
            element.accept(visitor);
        }
    }

}
